package zisu.netty.practice.netty.protocoltcp;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2020/8/11 11:20
 */
public class test {
    public static void main(String[] args) {
        Float a = (float) 12.5;
        //把浮点数转为二进制
        //先把浮点数转为10进制
        int i = Float.floatToIntBits(a);
        System.out.println("i:"+i);
        //再把10进制转为 二进制
        String s = Integer.toBinaryString(i);
        System.out.println("s:"+s);
        /**
         * i:-1052246016
         * s:11000001010010000000000000000000
         *
         * i:1095237632
         * s:1000001010010000000000000000000
         *
         *
         * 100 0001 0100 1000 0000 0000 0000 0000
         * */
    }
}
